package com.ruoyi.web.websocket;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Enumeration;
import java.util.concurrent.ConcurrentHashMap;


@RestController
@RequestMapping("/websocket")
public class WebSocketController {


    @GetMapping("/pushone")
    public void pushone()
    {
        ConcurrentHashMap<String, WebSocketClient> map = WebSocketService.getWebSocketMap();
        Enumeration<String> enu = map.keys();
        while (enu.hasMoreElements()) {
            WebSocketService.sendMessage(enu.nextElement().toString(), " 业务？？？ ");

        }
    }
}
